from django.db import models

from app.models import Product


class CommonProduct(models.Model):
    product = models.ForeignKey(Product, verbose_name=u'商品')
    prior = models.PositiveIntegerField(default=0, verbose_name=u'优先级')

    class Meta:
        verbose_name = u'常用清单'
        verbose_name_plural = u'常用清单'

    def __str__(self):
        return self.product.name if self.product else 'Common Product'
